package com.yangle.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = "eureka-client-order-service",configuration = FeignConfig.class,fallbackFactory =UserFeignFallBackFactory.class)
public interface UserFeign {
    @GetMapping("/user/get")
    User getUser(@RequestParam("name") String name);

    @PostMapping("/user/getMap")
    User getUser(@RequestParam Map<String, String> param);

    @PostMapping("/user/add")
    User addUser(@RequestParam("name") String name, @RequestParam("email") String email);

    @PostMapping("/user/addBody")
    User addUser(@RequestBody User user);
}
